GBML manual / Backgrounds

actor_pin_x

Where a named point of the Background Actor's picture (a pin, made in the Paint tab) is in the room right now, across, after the picture was moved, scaled and turned: put a sprite there and it stays on that point.

Game Boy: not available

Game Boy Color: not available

Sega Genesis: not built yet

On other consoles this differs: see Side by side and How the consoles differ.

Syntax

actor_pin_x(pin) -> real

Arguments

NameType
pinstring

Returns

real

Description

Where a named point of the Background Actor's picture (a pin, made in the Paint tab) is in the room right now, across, after the picture was moved, scaled and turned. Put a sprite there and it stays on that point. It answers 0 in a room that has no zoomable background, and for a name that is not one of the picture's pins.

The answer is counted from the room's top-left corner, like an object's x. It is worked out from the same numbers the console draws the picture with, so a sprite put on it lands within a pixel nearly always and within two at worst (the console draws the picture on whole pixels). Make a hit area about two pixels bigger than it looks. Set the actor's place, scale and angle before asking in the same event, so the answer is for this frame's picture.

Example

// Step event of a pustule: it sits on the pin called pustule_1.
x = actor_pin_x("pustule_1");
y = actor_pin_y("pustule_1");

The pustule's own position is set to the pin every frame, so it follows the picture as it sways, swells and turns.

On the GBA

A no-op in a room that has no zoomable background (set the room's Zoomable background to an actor picture). Counted from the room's top-left corner, as an object's x. It is worked out from the numbers the console draws the picture with, so a sprite put on it lands within a pixel nearly always and within two at worst (the console draws the picture on whole pixels): make a hit area about two pixels bigger than it looks. Set the actor's place, scale and angle BEFORE asking in the same event, so the answer is for this frame's picture. A name that is not one of the picture's pins answers 0.

See also: Background actorsactor_pin_yactor_placeactor_picture